package com.mc.mcgoweb.listener;

import com.google.common.collect.Lists;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;

/**
 * 容器监听器
 *
 * @author cc
 * @since 1.0
 */
@WebListener
public class ContainerListener implements ServletContextListener {
// static final        String driver = null;
//    static final        String driver = null;
//    static final        String driver = null;
//    static final        String driver = null;

    /**
     * 当容器初始化时调用
     */
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("容器初始化的时候调用ServletContextListener");
    }

    public static void main(String[] args) {
        Instant now = Instant.now();
        Instant now1 = Instant.now();
        System.out.println( Duration.between(now, now1).toMillis() + "ms");

        int i=100_000; //java 1.7后的特性。代表一百个1000
        int g=10_00;
        System.out.println(100_000.055555);
        ArrayList<Object> objects = Lists.newArrayList();
        objects.add(1);
        IntStream.range(0,objects.size()).forEach( e-> System.out.println(e));
    }



}
